Precise and Efficient Call Graph Construction for C Programs with Function Pointers

نویسندگان

  • Ana Milanova
  • Atanas Rountev
  • Barbara G. Ryder
چکیده

The use of pointers presents serious problems for software productivity tools for software understanding, restructuring, and testing. Pointers enable indirect memory accesses through pointer dereferences, as well as indirect procedure calls (e.g., through function pointers in C). Such indirect accesses and calls can be disambiguated with pointer analysis. In this paper we evaluate the precision of one specific pointer analysis (the FA pointer analysis by Zhang et al.) for the purposes of call graph construction for C programs with function pointers. The analysis is incorporated in a production-strength code-browsing tool from Siemens Corporate Research in which the program call graph is used as a primary tool for code understanding. The FA pointer analysis uses an inexpensive, almostlinear, flowand context-insensitive algorithm. To measure analysis precision, we compare the call graph constructed by this analysis with the most precise call graph obtainable by a large category of existing pointer analyses. Surprisingly, for all our data programs the FA analysis achieves the best possible precision. This result indicates that for the purposes of call graph construction, even inexpensive pointer analyses may provide precision comparable to the precision of expensive pointer analyses, and therefore the use of more expensive analyses may be unnecessary.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Precise Call Graph Construction in the Presence of Function Pointers

The use of pointers presents serious problems for software productivity tools for software understanding, restructuring, and testing. Pointers enable indirect memory accesses through pointer dereferences, as well as indirect procedure calls (e.g., through function pointers in C). Such indirect accesses and calls can be disambiguated with pointer analysis. In this paper we evaluate the precision...

متن کامل

An Empirical Study of Function Pointers Using SPEC Benchmarks

Since the C language imposes little restriction on the use of function pointers, the task of call graph construction for a C program is far more di cult than what the algorithms designed for Fortran can handle. From the experience of implementing a call graph extractor in the IMPACT compiler, we found the call graph construction problem has evolved into an interprocedural pointer analysis probl...

متن کامل

Call Graph Extraction in the Presence of Function Pointers

Software engineers need to understand programs in order to effectively maintain them. The call graph, which presents the calling relationships between functions, is a useful representation of a program that can aid understanding. For programs without the use of function pointers, the call graph can be extracted by parsing the program. However, for programs with function pointers, call graph ext...

متن کامل

Impact of Function Pointers on the Call Graph

Maintenance activities are made more difficult when pointers are heavily used in source code: the programmer needs to build a mental model of memory locations and of the way they are accessed by means of pointers, in order to comprehend the functionalities of the system. Although several points-to analysis algorithms have been proposed in literature to provide information about memory locations...

متن کامل

Program Slicing Using Dynamic Points-To Data

Program slicing is a potentially beneficial analysis for aiding program understanding. However, slices of even small programs are often too large to be generally useful. Imprecise pointer analyses have been suggested as one cause of this problem. In this paper, we explore using dynamic points-to information as an alternative to static information to improve precision. Since dynamic points-to da...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2003